bbedit "/Volumes/Work/Open Firmware and Name Registry/ROM Nvidia/6200/Notes/memory map.worksheet"
bbedit "/Volumes/Work/Open Firmware and Name Registry/ROM PowerPC Mac/ROM 2.4 Beige G3 rev C/Other/G3 Open Firmware 2.4 memory map.txt"
bbedit "/Volumes/Work/Open Firmware and Name Registry/ROM PowerPC Mac/ROM 2.4 Beige G3 rev C/Other/Open Firmware memory map, startvec, stacks, etc..txt"
bbedit "/Volumes/Work/Open Firmware and Name Registry/ROM PowerPC Mac/ROM 2.4 Beige G3 rev C/Other/Open Firmware Fields.txt"
bbedit "/Volumes/Work/Open Firmware and Name Registry/ROM PowerPC Mac/ROM 2.4 Beige G3 rev C/Other/Open Firmware Fields.of"
bbedit "/Volumes/Work/Open Firmware and Name Registry/ROM PowerPC Mac/ROM 5.2.7f1 G5 Quad/other/@startvec fields and OF memory map.txt"

\ ======================================================================
\ For Open Firmware 2.4 and earlier, >h.count needs to be changed to 4+ because xt>hdr points to >h.flags instead of >h.link

: dump-fields { addr fcodestart fcodeend ; token ptr }
	cr
	fcodeend 1+ fcodestart do
		i ." 0x" 4 u.r space
		i get-token drop -> token
		0 token execute 4 u.r space
		addr token execute dup 8 u.r space
		token name.
		#out @ d# 42 < if d# 42 #out @ - spaces then
		@ -> ptr
		ptr 8 u.r space
		\ check if the field might point to a xt token and if so, output its name
		ptr @startvec u> ptr 7 and 0= and if
			ptr xt>hdr ( 4+ ) >h.count dup c@ + 8 + -8 and ptr = if ptr name. then
		then
		cr
	loop
;

: dump-startvec
	\ Dump all fields of @startvec
	@startvec 10e5 114b dump-fields
	;

\ ======================================================================
\ dump-startvec

0x10e5 0000 ff844c00 >dir.inst0           04000000
0x10e6 0004 ff844c04 >dir.inst1           4800027d
0x10e7 0010 ff844c10 >dir.version         00000000
0x10e8 0014 ff844c14 >dir.hwinit-size     00000000
0x10e9 0018 ff844c18 >dir.of              00200000
0x10ea 001c ff844c1c >dir.of-size         0007956d
0x10eb 0020 ff844c20 >dir.drivers         00279580
0x10ec 0024 ff844c24 >dir.uncompress-size 00000000
0x10ed 0028 ff844c28 >dir.boot-beep       00000000
0x10ee 002c ff844c2c >dir.boot-beep-size  00000000
0x10ef 0030 ff844c30 >imagesize           00000000
0x10f0 0034 ff844c34 >'cold2              00000000
0x10f1 0038 ff844c38 >'map-page           00000000
0x10f2 003c ff844c3c >'map-io             00000000
0x10f3 0040 ff844c40 >endiango            ff845680
0x10f4 0044 ff844c44 >little?             00000000
0x10f5 0048 ff844c48 >swizzle?            00000000
0x10f6 004c ff844c4c >real?               00000000
0x10f7 0050 ff844c50 >direct-macio?       00000000
0x10f8 0054 ff844c54 >mlb-bridge?         ffffffff
0x10f9 0058 ff844c58 >rom-base            00200000
0x10fa 005c ff844c5c >mem_base            7f5f0000
0x10fb 0060 ff844c60 >real_base           7fc00000
0x10fc 0064 ff844c64 >virt_base           ff800000
0x10fd 0068 ff844c68 >logger_base         ff7f0000
0x10fe 006c ff844c6c >mem_size            00a10000
0x10ff 0070 ff844c70 >real_size           00400000
0x1100 0074 ff844c74 >logger_size         00010000
0x1101 0078 ff844c78 >load_base           00800000
0x1102 007c ff844c7c >real-vt-hd          7ff7f950
0x1103 0080 ff844c80 >restart?            00000000
0x1104 0084 ff844c84 >fcimage             0020c600
0x1105 0088 ff844c88 >fcfiles             ff8646a0 ^ff86.469c
0x1106 008c ff844c8c >word-list           ffa3be20
0x1107 0090 ff844c90 >'ferror             ff84d168 ferror
0x1108 0094 ff844c94 >'(poplocals)        ff8471e0 (poplocals)
0x1109 0098 ff844c98 >'cold-load          ff8511e8 cold-load
0x110a 009c ff844c9c >'cold-init          ff9bd958 (cold-init)
0x110b 00a0 ff844ca0 >'quit               ff852958 quit
0x110c 00a4 ff844ca4 >'abort              ff85e700 abort
0x110d 00a8 ff844ca8 >'syscatch           ff86f040 (syscatch)
0x110e 00ac ff844cac >'excp               ff86bc48 _exception
0x110f 00b0 ff844cb0 >'bp-done            ff898ba0 bp-done
0x1110 00b4 ff844cb4 >'step-done          ff898c38 step-done
0x1111 00b8 ff844cb8 >'mini-nub           00000000
0x1112 00bc ff844cbc >hwinitlr            00f80204
0x1113 00c0 ff844cc0 >hwinitiv            00000000
0x1114 00c4 ff844cc4 >hwinit3             00100000
0x1115 00c8 ff844cc8 >hwinit4             00000000
0x1116 00cc ff844ccc >hwiflags            48ffda7c
0x1117 00d0 ff844cd0 >memhash             00000000
0x1118 00d4 ff844cd4 >sccac               00000000
0x1119 00d8 ff844cd8 >sccad               00000000
0x111a 00dc ff844cdc >ramsize             80000000
0x111b 00e0 ff844ce0 >ramsize4            22000000
0x111c 00e0 ff844ce0 >l2code              22000000
0x111d 00e4 ff844ce4 >cpuclock            9502f900
0x111e 00e8 ff844ce8 >busclock            4a817c80
0x111f 00ec ff844cec >tbclock             01fca055
0x1120 00f0 ff844cf0 >pciclock            01fca055
0x1121 00f4 ff844cf4 >cpu#                00000000
0x1122 00f8 ff844cf8 >here                ffa3be5c
0x1123 00fc ff844cfc >free-top            ffb80000 ^ffb7.fff8
0x1124 0100 ff844d00 >free-bot            ffb00000
0x1125 0104 ff844d04 >#dsi-ints           000007fe
0x1126 0108 ff844d08 >#isi-ints           00000000
0x1127 010c ff844d0c >dl-buf              ffbc0800
0x1128 0110 ff844d10 >ttp800              ff806c00
0x1129 0114 ff844d14 >ttp800-main         ffb64000
0x112a 0118 ff844d18 >ttp800-stack        00000000
0x112b 011c ff844d1c >'cientry            ff846d78 cientry
0x112c 0120 ff844d20 >'cicall             ff8a0858 cicall
0x112d 0124 ff844d24 >'my-self            ff84de30
0x112e 0128 ff844d28 >'my-vector          ff84de58
0x112f 012c ff844d2c >'active-pkg         ff84de10
0x1130 0130 ff844d30 >ofregsv             ffb7f400
0x1131 0134 ff844d34 >ciregsv             ffb7f000
0x1132 0138 ff844d38 >ofregsr             7ff7f400
0x1133 013c ff844d3c >ciregsr             7ff7f000
0x1134 0140 ff844d40 >intvectv            ffb7e800
0x1135 0144 ff844d44 >intvectr            7ff7e800
0x1136 0148 ff844d48 >regsvalid?          ff844c00
0x1137 014c ff844d4c >ciwords             ff8a04e0
0x1138 0150 ff844d50 >ci-ep               00000000
0x1139 0154 ff844d54 >throw-log           ff851280
0x113a 0158 ff844d58 >htab                7ff80000
0x113b 015c ff844d5c >64bit?              00000000
0x113c 0160 ff844d60 >rp                  ff800800
0x113d 0164 ff844d64 >dp                  ff800400
0x113e 0168 ff844d68 >fp                  ff801c00
0x113f 016c ff844d6c >lp                  ff801400
0x1140 0170 ff844d70 >ep                  ff802400
0x1141 0174 ff844d74 >ttp                 ff804c00
0x1142 0178 ff844d78 >tib                 ff802800
0x1143 017c ff844d7c >noname              ff802c00
0x1144 0180 ff844d80 >dec-ints            002a76a2
0x1145 0184 ff844d84 >dec-rlds            00000000
0x1146 0188 ff844d88 >dec-msec            00008235
0x1147 018c ff844d8c >protected-mem       00000000
0x1148 0190 ff844d90 >mem-violation       00000000
0x1149 0198 ff844d98 >r13-31              00000000
0x114a 0230 ff844e30 >quick-restart?      00000000
0x114b 0234 ff844e34 >startvec.lastoffset 00000000

\ ======================================================================
\ Open Firmware memory map for OF 5.2.7f1
\
\ fields marked "\ real" store a real address (decrease 3 most significant digits by 7fc)

ff7f0000 >logger_base         \ real 7fbf0000

ff800000 (Start of Open Fimrware space)
ff800000 >real_base           \ real 7fc00000 \ real
ff800000 >virt_base           \ real 7fc00000
ff800400 >dp
ff800800 >rp
ff801400 >lp
ff801c00 >fp
ff802400 >ep
ff802800 >tib
ff802c00 >noname
                              \ [ tokens 0x0000 to 0xffff
ff804c00 >ttp                 \   tokens 0x0000 to 0x07ff
ff806c00 >ttp800              \   tokens 0x0800 to 0x0fff
ff808c00                      \   tokens 0x1000 to 0xffff
                              \ ]
ff844c00 >regsvalid?          \ offset 0 in Part1.txt = @startvec
ff845680 >endiango            \ offset A80 in Part1.txt
ff846d78 >'cientry            cientry
ff8471e0 >'(poplocals)        (poplocals)
ff84d168 >'ferror             ferror
ff84de10 >'active-pkg
ff84de30 >'my-self
ff84de58 >'my-vector
ff8511e8 >'cold-load          cold-load
ff851280 >throw-log
ff852958 >'quit               quit
ff85e700 >'abort              abort
ff8646a0 >fcfiles             ^ff86.469c
ff86bc48 >'excp               _exception
ff86f040 >'syscatch           (syscatch)
ff898ba0 >'bp-done            bp-done
ff898c38 >'step-done          step-done
ff8a04e0 >ciwords
ff8a0858 >'cicall             cicall
ff9bd958 >'cold-init          (cold-init)
ffa3be20 >word-list
ffa3be5c >here
ffb00000 >free-bot
ffb64000 >ttp800-main
ffb7e800 >intvectr            \ real 7ff7e800 \ real
ffb7e800 >intvectv
ffb7f000 >ciregsr             \ real 7ff7f000 \ real
ffb7f000 >ciregsv
ffb7f400 >ofregsr             \ real 7ff7f400 \ real
ffb7f400 >ofregsv
ffb7f950 >real-vt-hd          \ real 7ff7f950 \ real
ffb80000 >free-top            ^ffb7.fff8
ffb80000 >htab                \ real 7ff80000 \ real
ffbc0800 >dl-buf              \ real 7ffc0800
ffc00000 (End of open Firmware space)

\ ======================================================================

0 > .translations 
Virtual = 00000000 Size = 00003000 Physical = 000.00000000 Mode = 10 
Virtual = 7f5f0000 Size = 00200000 Physical = 000.7f5f0000 Mode = 10 
Virtual = 7f7f0000 Size = 00200000 Physical = 000.7f7f0000 Mode = 10 
Virtual = 7f9f0000 Size = 00200000 Physical = 000.7f9f0000 Mode = 10 
Virtual = 7ff69000 Size = 00001000 Physical = 000.7ff69000 Mode = 28 
Virtual = 80000000 Size = 00080000 Physical = 000.80000000 Mode = 28 
Virtual = 80081000 Size = 00001000 Physical = 000.80081000 Mode = 28 
Virtual = 80082000 Size = 00001000 Physical = 000.80082000 Mode = 28 
Virtual = f0000000 Size = 00010000 Physical = 000.f0000000 Mode = 28 
Virtual = f0800000 Size = 00001000 Physical = 000.f0800000 Mode = 28 
Virtual = f0c00000 Size = 00001000 Physical = 000.f0c00000 Mode = 28 
Virtual = f2000000 Size = 02800000 Physical = 000.f2000000 Mode = 28 
Virtual = f4000000 Size = 00400000 Physical = 000.f4000000 Mode = 28 
Virtual = f8000000 Size = 01000000 Physical = 000.f8000000 Mode = 28 
Virtual = f8070000 Size = 00001000 Physical = 000.f8070000 Mode = 28 
Virtual = fa400000 Size = 00001000 Physical = 000.fa400000 Mode = 28 
Virtual = fa402000 Size = 00002000 Physical = 000.fa402000 Mode = 28 
Virtual = fa500000 Size = 00010000 Physical = 000.fa500000 Mode = 28 
Virtual = fa510000 Size = 00010000 Physical = 000.fa510000 Mode = 28 
Virtual = fa520000 Size = 00010000 Physical = 000.fa520000 Mode = 28 
Virtual = fa520000 Size = 00010000 Physical = 000.fa520000 Mode = 28 
Virtual = fa530000 Size = 00010000 Physical = 000.fa530000 Mode = 28 
Virtual = fa530000 Size = 00010000 Physical = 000.fa530000 Mode = 28 
Virtual = ff7f0000 Size = 00010000 Physical = 000.7fbf0000 Mode = 10 
Virtual = ff800000 Size = 00400000 Physical = 000.7fc00000 Mode = 10 
Virtual = fff04000 Size = 00002000 Physical = 000.fff04000 Mode = 28 
Virtual = fff06000 Size = 00002000 Physical = 000.fff06000 Mode = 28  ok

\ ======================================================================
